/**
 * 
 */
package com.wandar.gc.schema;

import com.wandar.gc.util.StringUtil;

/**
 * @author huangxm
 * 
 */
public class ConfigSchema {

	/** mapper上下文配置文件路径 */
	private String mapperContextPath;

	/** mybatis基础配置文件路径 */
	private String mapperConfigPath;

	private String entityName;

	/** 变量名称 */
	private String variableName;

	private String tableName;

	private String databaseName;

	/** sql join 表别名 避免字段冲突 */
	private String joinAlias;

	/** 模型生成配置 */
	private EntitySchema entitySchema;

	/**
	 * 
	 */
	public ConfigSchema() {
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public EntitySchema getEntitySchema() {
		return entitySchema;
	}

	public void setEntitySchema(EntitySchema entitySchema) {
		this.entitySchema = entitySchema;
	}

	public String getEntityName() {
		return entityName;
	}

	public void setEntityName(String entityName) {
		this.entityName = entityName;
	}

	public String getVariableName() {
		this.variableName = StringUtil.firstLetterToLowerCase(entityName);
		return variableName;
	}

	public void setVariableName(String variableName) {
		this.variableName = variableName;
	}

	public String getDatabaseName() {
		return databaseName;
	}

	public void setDatabaseName(String databaseName) {
		this.databaseName = databaseName;
	}

	public String getJoinAlias() {
		this.joinAlias = StringUtil.getfirstCharacter(tableName);
		return joinAlias;
	}

	public void setJoinAlias(String joinAlias) {
		this.joinAlias = joinAlias;
	}

	public String getMapperContextPath() {
		return mapperContextPath;
	}

	public void setMapperContextPath(String mapperContextPath) {
		this.mapperContextPath = mapperContextPath;
	}

	public String getMapperConfigPath() {
		return mapperConfigPath;
	}

	public void setMapperConfigPath(String mapperConfigPath) {
		this.mapperConfigPath = mapperConfigPath;
	}

}
